/* File parser.mly */
%token <int> INT
%token <float> FLOAT
%token LPAREN RPAREN
%token <string> STRING
%token <string> SYMBOL
%token QUOTE
%token <bool> BOOL
%start main             /* the entry point */
%type <Types.Data.t> main
%%
main:
  expr                 { $1 }
  ;
exprgroup:
  expr {Types.Data.List [$1]}
  | expr exprgroup {Types.Data.cons (Types.Data.List [($1);($2)])}
expr:
    INT                      { Types.Data.Int $1 }
  | FLOAT                    { Types.Data.Float $1 }
  | BOOL                     { Types.Data.Bool $1 }
  | SYMBOL                   { Types.Data.Symbol $1 }
  | STRING                   { Types.Data.String $1 }
  | QUOTE expr               { Types.Data.List [Types.Data.Symbol "quote";$2] }
  | LPAREN exprgroup RPAREN  { $2 }
  ;
